#ifndef CAMPAIGNSKILLPROXYMODEL_H
#define CAMPAIGNSKILLPROXYMODEL_H

#include "AbstractCampaignItemModel.h"



#include <QMap>



/******************************************
* Campaign-wise skills have following data:
* - Name
* - Attribute
* - Synergies
* - Description
* - Subskills, if any
*******************************************/

class CampaignSkillProxyModel : public AbstractCampaignItemModel
{
    Q_OBJECT

public:

    enum SkillData
    {
        SkillData_FIRST = 0,

        SkillName = SkillData_FIRST,
        SkillRef,

        SkillData_LAST = SkillRef
    };

    CampaignSkillProxyModel(QObject *parent = 0);

    virtual QModelIndex index(int row, int column, const QModelIndex &parent) const;
    virtual QModelIndex parent(const QModelIndex &child) const;

    virtual int rowCount(const QModelIndex &parent) const;
    virtual int columnCount(const QModelIndex &parent) const;

    virtual QVariant data(const QModelIndex &index, int role) const;
    virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;

    //virtual bool setData(const QModelIndex &index, const QVariant &value, int role);

    virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const;
    virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const;



protected slots:

    virtual void remap();


protected:

    void mapItemIndexes(const QModelIndex& groupIndex);
    void mapRefIndexes(const QModelIndex& itemIndex);
    void mapSubSkills(const QModelIndex& refIndex);


protected:

    IndexMap m_skills;
    QMap<ProxyIndex, IndexMap> m_subSkills;


};



#endif // CAMPAIGNSKILLPROXYMODEL_H


